{{csrf_field()}}
<div class="layui-form-item">
    <input type="hidden" name="parent_id" value="{{$category->parent_id??$id}}" >
    <input type="hidden" name="level" value="{{$category->level??$level}}">
    @if($id && $region)
    <label for="" class="layui-form-label">上级地区</label>
    <div class="layui-input-block">
        <input type="text" value="{{ $region->name }}" readonly style="background:#ededed;" class="layui-input" >
    </div>
    @endif

</div>
<div class="layui-form-item">
    <label for="" class="layui-form-label">名称</label>
    <div class="layui-input-block">
        <input type="text" name="name" id="city" value="{{ $category->name ?? old('name') }}" lay-verify="required" placeholder="请输入名称" class="layui-input" >
    </div>
</div>
<div class="layui-form-item">
    <label for="" class="layui-form-label">检索</label>
    <div class="layui-input-inline">
        <input type="text" name="letter" value="{{ $category->letter ?? old('letter') }}" lay-verify="required" placeholder="城市拼音首字母大写，如 A" class="layui-input" >
    </div>
</div>
@if($level >= 1)
<div class="layui-form-item" style="display: flex;">
    <div class="layui-inline">
        <label for="" class="layui-form-label">地图标注</label>
        <div class="layui-input-inline" style="width:300px;">
            <input type="text" name="map" id="map" value="{{$category->map??old('map')}}" placeholder="标注经纬度" class="layui-input" >
        </div>
    </div>
    <button type="button" class="layui-btn layui-btn-danger"  id="getmap">获取标注</button>
{{--    <input type="hidden" id="uri" value="{{env('APP_URI')}}">--}}
</div>
@endif
@if($level == 1)
<div class="layui-form-item">
    <label for="" class="layui-form-label">绑定域名</label>
    <div class="layui-input-inline">
        <input type="text" name="domain" value="{{ $category->domain ?? old('domain') }}" placeholder="绑定子域名" class="layui-input" >
    </div>
    <div class="layui-form-mid layui-word-aux">.{{env('APP_DOMAIN')}}</div>
</div>
@endif
@if($level >= 1)
<div class="layui-form-item">
    <label for="" class="layui-form-label">热门</label>
    <div class="layui-input-block">
        <input type="radio" name="is_hot" value="F" title="否" @if(isset($category->is_hot) && $category->is_hot == 'F') checked @elseif(!isset($category->is_hot)) checked @endif>
        <input type="radio" name="is_hot" value="T" title="是" @if(isset($category->is_hot) && $category->is_hot == 'T') checked @endif>
    </div>
</div>
@endif
@if($level == 1)
{{--<div class="layui-form-item">--}}
{{--    <label for="" class="layui-form-label">SEO标题</label>--}}
{{--    <div class="layui-input-block">--}}
{{--        <input type="text" name="seo_title" value="{{ $category->seo_title ?? old('seo_title') }}" placeholder="seo标题" class="layui-input" >--}}
{{--    </div>--}}
{{--</div>--}}
{{--<div class="layui-form-item">--}}
{{--    <label for="" class="layui-form-label">SEO关键词</label>--}}
{{--    <div class="layui-input-block">--}}
{{--        <input type="text" name="seo_keywords" value="{{ $category->seo_keywords ?? old('seo_keywords') }}" placeholder="seo关键词" class="layui-input" >--}}
{{--    </div>--}}
{{--</div>--}}
{{--<div class="layui-form-item">--}}
{{--    <label for="" class="layui-form-label">SEO描述</label>--}}
{{--    <div class="layui-input-block">--}}
{{--        <textarea name="seo_description" placeholder="SEO描述" class="layui-textarea">{{ $category->seo_description ?? old('seo_description') }}</textarea>--}}
{{--    </div>--}}
{{--</div>--}}
@endif
<div class="layui-form-item">
    <label for="" class="layui-form-label">排序</label>
    <div class="layui-input-block">
        <input type="text" name="sort" value="{{ $category->sort ?? 0 }}" lay-verify="required|number" placeholder="请输入数字" class="layui-input" >
    </div>
</div>
<div class="layui-form-item">
    <label for="" class="layui-form-label">状态</label>
    <div class="layui-input-block">
        <input type="radio" name="status" value="T" title="启用" @if(isset($category->status) && $category->status == 'T') checked @elseif(!isset($category->status)) checked @endif>
        <input type="radio" name="status" value="F" title="禁用" @if(isset($category->status) && $category->status == 'F') checked @endif>
    </div>
</div>
<div class="layui-form-item">
    <div class="layui-input-block">
        <button type="submit" class="layui-btn" lay-submit="" lay-filter="formDemo">确 认</button>
        <a  class="layui-btn" href="{{route('admin.region')}}" >返 回</a>
    </div>
</div>